#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <string>
using namespace std;

int main()
{
    long long n, l, r, left = 0, right = 0, count = 0, ret1 = 0, ret2 = 0;
    cin >> n >> l >> r;
    string s;
    cin >> s;
    long long hash[26] = { 0 }, hash1[26] = { 0 };
    while (right < n)
    {
        if (!hash[s[right] - 'a']++) count++;
        while (count > l - 1)
        {
            ret1 += right - left;
            if (--hash[s[left++] - 'a'] == 0) count--;
        }
        right++;
    }
    long long i = right - left;
    ret1 += (1 + i) * i / 2;
    left = right = count = 0;
    while (right < n)
    {
        if (!hash1[s[right] - 'a']++) count++;
        while (count > r)
        {
            ret2 += right - left;
            if (--hash1[s[left++] - 'a'] == 0) count--;
        }
        right++;
    }
    i = right - left;
    ret2 += (1 + i) * i / 2;
    cout << ret2 - ret1;
}